//
//  FirstViewController.m
//  标签控制器
//
//  Created by apple on 15/9/17.
//  Copyright (c) 2015年 戴维营. All rights reserved.
//

#import "FirstViewController.h"
#import "FourViewController.h"

@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor orangeColor];
    
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
    
    [btn addTarget:self action:@selector(didClicked:) forControlEvents:UIControlEventTouchUpInside];
    
    [btn setTitle:@"下一页" forState:UIControlStateNormal];
    
    btn.frame = CGRectMake(100, 60, 120, 40);
    
    [self.view addSubview:btn];
    
}

- (void)didClicked:(UIButton *)sender
{
//    FourViewController *fourCtrl = [FourViewController new];
//    
////    自动隐藏TabBar
//    fourCtrl.hidesBottomBarWhenPushed = YES;
//    
//    [self.navigationController pushViewController:fourCtrl animated:YES];
//
    
    self.tabBarController.selectedIndex = 2;
}
@end
